using System;

namespace Atomic.Thermodynamics.StateEquations
{
	[Serializable]
	public class VinetStateEquation
	{
		public VinetStateEquation()
		{
		}

		public double Value(double v)
		{
			// http://www.sklogwiki.org/SklogWiki/index.php/Rose-Vinet_%28Universal%29_equation_of_state
			double eta = Math.Pow(v / V0, 1.0 / 3.0);
			return 3.0 * B0 * (1.0 - eta) / (eta * eta) * Math.Exp(1.5 * (Bp0 - 1.0) * (1.0 - eta)); 
		}

		public double V0
		{
			get;
			private set;
		}

		public double B0
		{
			get;
			private set;
		}

		public double Bp0
		{
			get;
			private set;
		}
	}
}
